<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
  
  <head>
    <title>医生详情</title>
    <jsp:include page="header.jsp"></jsp:include>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <style>
  	.my-pic {
  		display: block;
  		width: 132px;
  		height: 132px;
  	}
  	.my-pic img{
  		display: block;
  		width: 100%;
  		height: 100%;
  	}
  	.my-span {
  		display: block;
  		margin-top: 10px;
  	}
  </style>
  <body>
    <div class="x-body">
        <form class="layui-form" id="myForm">
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	医生姓名:
              </label>
              <div class="layui-input-inline">
                 <input type="text" id="doctorName" name="doctorName" required="" lay-verify="required"
                  autocomplete="off" class="layui-input" value="${doctor.doctorName}">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	医生电话:
              </label>
              <div class="layui-input-inline">
                 <input type="text" id="doctorTelephone" name="doctorTelephone" required="" lay-verify="phone"
                  autocomplete="off" class="layui-input" value="${doctor.doctorTelephone}">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  	微信名称:
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="doctorWename" name="doctorWename" required="" lay-verify="required"
                  autocomplete="off" class="layui-input" value="${doctor.doctorWename}">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  	医院名称:
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="doctorHospital" name="doctorHospital" required="" lay-verify="required"
                  autocomplete="off" class="layui-input" value="${doctor.doctorHospital}">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                 	性别:
              </label>
              <div class="layui-input-inline">
			      <input type="radio" name="doctorGendle" value="男" title="男">
			      <input type="radio" name="doctorGendle" value="女" title="女" checked>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	科室:
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="doctorKeshi" name="doctorKeshi"  lay-verify="required"
                  autocomplete="off" class="layui-input" value="${doctor.doctorKeshi}">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                	  级别:
              </label>
              <div class="layui-input-inline">
                   <input type="text" id="doctorJibie" name="doctorJibie" required="" lay-verify="required"
                  autocomplete="off" class="layui-input" value="${doctor.doctorJibie}">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	指定销售员:
              </label>
              <div class="layui-input-inline">
                 <select name="doctorRemark" class="input w50" id="orderBy">
	              <option value="">请选择销售员</option>
	              <c:if test="${not empty doctorlist}">
      				<c:forEach var="app" items="${doctorlist}" varStatus="st">
		              <option value="${app.realName}">${app.realName}</option>
		              
	              </c:forEach>
	              </c:if>
            </select>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              	<input type="hidden" name="id" value="${doctor.id}">
              </label>
             <button  class="layui-btn" lay-filter="add" id="my_add">
                  	确定
              </button>
          </div>
      </form>
    </div>
    <script type="text/javascript">
    $("#orderBy option").each(function() { 
		//console.log($(this).val());
		if ($(this).val() == '${doctor.doctorRemark}') { 
		$(this).attr("selected", "selected"); 
		} 
		}); 
    $('#my_add').click(function(){
    	 var myform =$('#myForm');
    	 var rr ="/admin/doctorSave";
         $.post(rr,myform.serialize(),
                 function (data) {
                     if('ok'==data){
                    	 parent.location.reload();
                         x_admin_close();
                     }
                 }
             ); 
         return false;
    });
	</script>
  </body>
</html>